/** 
 * Project Name:kaka 
 * File Name:BasicInfoServiceImpl.java 
 * Package Name:com.luoran.kaka.service.impl 
 * Date:2018年11月21日下午5:53:39 
 * Copyright (c) 2018, Luoran, Inc. All Rights Reserved.
 * 
 */  
package com.luoran.kaka.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.luoran.kaka.dao.IBasicInfoDao;
import com.luoran.kaka.entity.BasicInfo;
import com.luoran.kaka.service.IBasicInfoService;

/** 
 * ClassName: BasicInfoServiceImpl
 * date: 2018年11月21日 下午5:53:39
 * @author ghl 
 * @since JDK 1.8
 */
@Service
public class BasicInfoServiceImpl implements IBasicInfoService {
	
	@Autowired
	private IBasicInfoDao basicInfoDao;

	/** 
	 * @see com.luoran.kaka.service.IBasicInfoService#add(com.luoran.kaka.entity.BasicInfo) 
	 */
	@Override
	public String add(BasicInfo basicInfo) {
		basicInfoDao.insertTemplate(basicInfo);
		return basicInfo.getId();
	}

	/** 
	 * @see com.luoran.kaka.service.IBasicInfoService#getBasicInfoById(java.lang.String) 
	 * @param userId
	 * @return
	 * @author ghl 2018年11月25日下午10:22:47
	 * getBasicInfoById:
	 */  
	@Override
	public BasicInfo getBasicInfoById(String userId) {
		return basicInfoDao.single(userId);
	}

	/** 
	 * @see com.luoran.kaka.service.IBasicInfoService#updateUserInfo(com.luoran.kaka.entity.BasicInfo) 
	 * @param basicInfo
	 * @return
	 * @author ghl 2018年11月26日上午12:11:00
	 * updateUserInfo:修改
	 */  
	@Override
	public int updateUserInfo(BasicInfo basicInfo) {
		int count = basicInfoDao.updateTemplateById(basicInfo);
		return count;
	}

	/** 
	 * @see com.luoran.kaka.service.IBasicInfoService#getAllPersonalCardByOpenId(java.lang.String) 
	 * @param openId
	 * @return
	 * @author ghl 2018年12月6日下午5:22:58
	 * getAllPersonalCardByOpenId:
	 */  
	@Override
	public List<BasicInfo> getAllMyPersonalCardByOpenId(String openId) {
		List<BasicInfo> list = basicInfoDao.getAllMyPersonalCardByOpenId(openId);
		return list;
	}

}
